package com.pp.ent.base.concurrent;

/**
 * Created by dengqu on 2016/11/11.
 */

public class XLCommandResult<T> {
    public enum ResultCode {
        SUCCESSFUL,
        FAILED
    }

    public XLCommandResult.ResultCode resultCode;
    public T data;

    public XLCommandResult() {
        resultCode = XLCommandResult.ResultCode.SUCCESSFUL;
    }

    public XLCommandResult(XLCommandResult.ResultCode result, T data) {
        this.resultCode = result;
        this.data = data;
    }

    public boolean isSuccessful() {
        return resultCode == XLCommandResult.ResultCode.SUCCESSFUL;
    }
}
